import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/education_everyday_quiz_entity.dart';

EducationEverydayQuizEntity $EducationEverydayQuizEntityFromJson(Map<String, dynamic> json) {
  final EducationEverydayQuizEntity educationEverydayQuizEntity = EducationEverydayQuizEntity();
  final String? duration = jsonConvert.convert<String>(json['duration']);
  if (duration != null) {
    educationEverydayQuizEntity.duration = duration;
  }
  final List<EducationEverydayQuizQuestionAllList>? questionAllList = (json['questionAllList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<EducationEverydayQuizQuestionAllList>(e) as EducationEverydayQuizQuestionAllList).toList();
  if (questionAllList != null) {
    educationEverydayQuizEntity.questionAllList = questionAllList;
  }
  final int? questionCount = jsonConvert.convert<int>(json['questionCount']);
  if (questionCount != null) {
    educationEverydayQuizEntity.questionCount = questionCount;
  }
  final List<EducationEverydayQuizQuestionList>? questionList = (json['questionList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<EducationEverydayQuizQuestionList>(e) as EducationEverydayQuizQuestionList).toList();
  if (questionList != null) {
    educationEverydayQuizEntity.questionList = questionList;
  }
  final List<EducationEverydayQuizQuestionListOne>? questionListOne = (json['questionListOne'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<EducationEverydayQuizQuestionListOne>(e) as EducationEverydayQuizQuestionListOne).toList();
  if (questionListOne != null) {
    educationEverydayQuizEntity.questionListOne = questionListOne;
  }
  final int? questionScore = jsonConvert.convert<int>(json['questionScore']);
  if (questionScore != null) {
    educationEverydayQuizEntity.questionScore = questionScore;
  }
  final String? questionTypeDicId = jsonConvert.convert<String>(json['questionTypeDicId']);
  if (questionTypeDicId != null) {
    educationEverydayQuizEntity.questionTypeDicId = questionTypeDicId;
  }
  final String? timeCount = jsonConvert.convert<String>(json['timeCount']);
  if (timeCount != null) {
    educationEverydayQuizEntity.timeCount = timeCount;
  }
  return educationEverydayQuizEntity;
}

Map<String, dynamic> $EducationEverydayQuizEntityToJson(EducationEverydayQuizEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['duration'] = entity.duration;
  data['questionAllList'] = entity.questionAllList.map((v) => v.toJson()).toList();
  data['questionCount'] = entity.questionCount;
  data['questionList'] = entity.questionList.map((v) => v.toJson()).toList();
  data['questionListOne'] = entity.questionListOne.map((v) => v.toJson()).toList();
  data['questionScore'] = entity.questionScore;
  data['questionTypeDicId'] = entity.questionTypeDicId;
  data['timeCount'] = entity.timeCount;
  return data;
}

extension EducationEverydayQuizEntityExtension on EducationEverydayQuizEntity {
  EducationEverydayQuizEntity copyWith({
    String? duration,
    List<EducationEverydayQuizQuestionAllList>? questionAllList,
    int? questionCount,
    List<EducationEverydayQuizQuestionList>? questionList,
    List<EducationEverydayQuizQuestionListOne>? questionListOne,
    int? questionScore,
    String? questionTypeDicId,
    String? timeCount,
  }) {
    return EducationEverydayQuizEntity()
      ..duration = duration ?? this.duration
      ..questionAllList = questionAllList ?? this.questionAllList
      ..questionCount = questionCount ?? this.questionCount
      ..questionList = questionList ?? this.questionList
      ..questionListOne = questionListOne ?? this.questionListOne
      ..questionScore = questionScore ?? this.questionScore
      ..questionTypeDicId = questionTypeDicId ?? this.questionTypeDicId
      ..timeCount = timeCount ?? this.timeCount;
  }
}

EducationEverydayQuizQuestionAllList $EducationEverydayQuizQuestionAllListFromJson(Map<String, dynamic> json) {
  final EducationEverydayQuizQuestionAllList educationEverydayQuizQuestionAllList = EducationEverydayQuizQuestionAllList();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    educationEverydayQuizQuestionAllList.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    educationEverydayQuizQuestionAllList.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    educationEverydayQuizQuestionAllList.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    educationEverydayQuizQuestionAllList.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    educationEverydayQuizQuestionAllList.deleted = deleted;
  }
  final int? duration = jsonConvert.convert<int>(json['duration']);
  if (duration != null) {
    educationEverydayQuizQuestionAllList.duration = duration;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    educationEverydayQuizQuestionAllList.id = id;
  }
  final String? myValidity = jsonConvert.convert<String>(json['myValidity']);
  if (myValidity != null) {
    educationEverydayQuizQuestionAllList.myValidity = myValidity;
  }
  final String? optionA = jsonConvert.convert<String>(json['optionA']);
  if (optionA != null) {
    educationEverydayQuizQuestionAllList.optionA = optionA;
  }
  final String? optionB = jsonConvert.convert<String>(json['optionB']);
  if (optionB != null) {
    educationEverydayQuizQuestionAllList.optionB = optionB;
  }
  final String? optionC = jsonConvert.convert<String>(json['optionC']);
  if (optionC != null) {
    educationEverydayQuizQuestionAllList.optionC = optionC;
  }
  final String? optionD = jsonConvert.convert<String>(json['optionD']);
  if (optionD != null) {
    educationEverydayQuizQuestionAllList.optionD = optionD;
  }
  final String? parsing = jsonConvert.convert<String>(json['parsing']);
  if (parsing != null) {
    educationEverydayQuizQuestionAllList.parsing = parsing;
  }
  final String? questionMain = jsonConvert.convert<String>(json['questionMain']);
  if (questionMain != null) {
    educationEverydayQuizQuestionAllList.questionMain = questionMain;
  }
  final String? questionTypeDicId = jsonConvert.convert<String>(json['questionTypeDicId']);
  if (questionTypeDicId != null) {
    educationEverydayQuizQuestionAllList.questionTypeDicId = questionTypeDicId;
  }
  final String? questionValidity = jsonConvert.convert<String>(json['questionValidity']);
  if (questionValidity != null) {
    educationEverydayQuizQuestionAllList.questionValidity = questionValidity;
  }
  final int? score = jsonConvert.convert<int>(json['score']);
  if (score != null) {
    educationEverydayQuizQuestionAllList.score = score;
  }
  final String? textbookId = jsonConvert.convert<String>(json['textbookId']);
  if (textbookId != null) {
    educationEverydayQuizQuestionAllList.textbookId = textbookId;
  }
  final String? timeCount = jsonConvert.convert<String>(json['timeCount']);
  if (timeCount != null) {
    educationEverydayQuizQuestionAllList.timeCount = timeCount;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    educationEverydayQuizQuestionAllList.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    educationEverydayQuizQuestionAllList.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    educationEverydayQuizQuestionAllList.updateDate = updateDate;
  }
  return educationEverydayQuizQuestionAllList;
}

Map<String, dynamic> $EducationEverydayQuizQuestionAllListToJson(EducationEverydayQuizQuestionAllList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['duration'] = entity.duration;
  data['id'] = entity.id;
  data['myValidity'] = entity.myValidity;
  data['optionA'] = entity.optionA;
  data['optionB'] = entity.optionB;
  data['optionC'] = entity.optionC;
  data['optionD'] = entity.optionD;
  data['parsing'] = entity.parsing;
  data['questionMain'] = entity.questionMain;
  data['questionTypeDicId'] = entity.questionTypeDicId;
  data['questionValidity'] = entity.questionValidity;
  data['score'] = entity.score;
  data['textbookId'] = entity.textbookId;
  data['timeCount'] = entity.timeCount;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension EducationEverydayQuizQuestionAllListExtension on EducationEverydayQuizQuestionAllList {
  EducationEverydayQuizQuestionAllList copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    int? duration,
    String? id,
    String? myValidity,
    String? optionA,
    String? optionB,
    String? optionC,
    String? optionD,
    String? parsing,
    String? questionMain,
    String? questionTypeDicId,
    String? questionValidity,
    int? score,
    String? textbookId,
    String? timeCount,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return EducationEverydayQuizQuestionAllList()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..duration = duration ?? this.duration
      ..id = id ?? this.id
      ..myValidity = myValidity ?? this.myValidity
      ..optionA = optionA ?? this.optionA
      ..optionB = optionB ?? this.optionB
      ..optionC = optionC ?? this.optionC
      ..optionD = optionD ?? this.optionD
      ..parsing = parsing ?? this.parsing
      ..questionMain = questionMain ?? this.questionMain
      ..questionTypeDicId = questionTypeDicId ?? this.questionTypeDicId
      ..questionValidity = questionValidity ?? this.questionValidity
      ..score = score ?? this.score
      ..textbookId = textbookId ?? this.textbookId
      ..timeCount = timeCount ?? this.timeCount
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}

EducationEverydayQuizQuestionList $EducationEverydayQuizQuestionListFromJson(Map<String, dynamic> json) {
  final EducationEverydayQuizQuestionList educationEverydayQuizQuestionList = EducationEverydayQuizQuestionList();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    educationEverydayQuizQuestionList.id = id;
  }
  final String? optionA = jsonConvert.convert<String>(json['optionA']);
  if (optionA != null) {
    educationEverydayQuizQuestionList.optionA = optionA;
  }
  final String? optionB = jsonConvert.convert<String>(json['optionB']);
  if (optionB != null) {
    educationEverydayQuizQuestionList.optionB = optionB;
  }
  final String? optionC = jsonConvert.convert<String>(json['optionC']);
  if (optionC != null) {
    educationEverydayQuizQuestionList.optionC = optionC;
  }
  final String? optionD = jsonConvert.convert<String>(json['optionD']);
  if (optionD != null) {
    educationEverydayQuizQuestionList.optionD = optionD;
  }
  final String? questionMain = jsonConvert.convert<String>(json['questionMain']);
  if (questionMain != null) {
    educationEverydayQuizQuestionList.questionMain = questionMain;
  }
  final String? questionTypeDicId = jsonConvert.convert<String>(json['questionTypeDicId']);
  if (questionTypeDicId != null) {
    educationEverydayQuizQuestionList.questionTypeDicId = questionTypeDicId;
  }
  final int? score = jsonConvert.convert<int>(json['score']);
  if (score != null) {
    educationEverydayQuizQuestionList.score = score;
  }
  return educationEverydayQuizQuestionList;
}

Map<String, dynamic> $EducationEverydayQuizQuestionListToJson(EducationEverydayQuizQuestionList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['optionA'] = entity.optionA;
  data['optionB'] = entity.optionB;
  data['optionC'] = entity.optionC;
  data['optionD'] = entity.optionD;
  data['questionMain'] = entity.questionMain;
  data['questionTypeDicId'] = entity.questionTypeDicId;
  data['score'] = entity.score;
  return data;
}

extension EducationEverydayQuizQuestionListExtension on EducationEverydayQuizQuestionList {
  EducationEverydayQuizQuestionList copyWith({
    String? id,
    String? optionA,
    String? optionB,
    String? optionC,
    String? optionD,
    String? questionMain,
    String? questionTypeDicId,
    int? score,
  }) {
    return EducationEverydayQuizQuestionList()
      ..id = id ?? this.id
      ..optionA = optionA ?? this.optionA
      ..optionB = optionB ?? this.optionB
      ..optionC = optionC ?? this.optionC
      ..optionD = optionD ?? this.optionD
      ..questionMain = questionMain ?? this.questionMain
      ..questionTypeDicId = questionTypeDicId ?? this.questionTypeDicId
      ..score = score ?? this.score;
  }
}

EducationEverydayQuizQuestionListOne $EducationEverydayQuizQuestionListOneFromJson(Map<String, dynamic> json) {
  final EducationEverydayQuizQuestionListOne educationEverydayQuizQuestionListOne = EducationEverydayQuizQuestionListOne();
  final String? addDate = jsonConvert.convert<String>(json['addDate']);
  if (addDate != null) {
    educationEverydayQuizQuestionListOne.addDate = addDate;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    educationEverydayQuizQuestionListOne.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    educationEverydayQuizQuestionListOne.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    educationEverydayQuizQuestionListOne.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    educationEverydayQuizQuestionListOne.createDate = createDate;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    educationEverydayQuizQuestionListOne.id = id;
  }
  final String? optionA = jsonConvert.convert<String>(json['optionA']);
  if (optionA != null) {
    educationEverydayQuizQuestionListOne.optionA = optionA;
  }
  final String? optionB = jsonConvert.convert<String>(json['optionB']);
  if (optionB != null) {
    educationEverydayQuizQuestionListOne.optionB = optionB;
  }
  final String? optionC = jsonConvert.convert<String>(json['optionC']);
  if (optionC != null) {
    educationEverydayQuizQuestionListOne.optionC = optionC;
  }
  final String? optionD = jsonConvert.convert<String>(json['optionD']);
  if (optionD != null) {
    educationEverydayQuizQuestionListOne.optionD = optionD;
  }
  final String? parsing = jsonConvert.convert<String>(json['parsing']);
  if (parsing != null) {
    educationEverydayQuizQuestionListOne.parsing = parsing;
  }
  final String? questionMain = jsonConvert.convert<String>(json['questionMain']);
  if (questionMain != null) {
    educationEverydayQuizQuestionListOne.questionMain = questionMain;
  }
  final String? questionTypeDicId = jsonConvert.convert<String>(json['questionTypeDicId']);
  if (questionTypeDicId != null) {
    educationEverydayQuizQuestionListOne.questionTypeDicId = questionTypeDicId;
  }
  final String? questionValidity = jsonConvert.convert<String>(json['questionValidity']);
  if (questionValidity != null) {
    educationEverydayQuizQuestionListOne.questionValidity = questionValidity;
  }
  final int? score = jsonConvert.convert<int>(json['score']);
  if (score != null) {
    educationEverydayQuizQuestionListOne.score = score;
  }
  final String? textbookId = jsonConvert.convert<String>(json['textbookId']);
  if (textbookId != null) {
    educationEverydayQuizQuestionListOne.textbookId = textbookId;
  }
  final int? type = jsonConvert.convert<int>(json['type']);
  if (type != null) {
    educationEverydayQuizQuestionListOne.type = type;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    educationEverydayQuizQuestionListOne.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    educationEverydayQuizQuestionListOne.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    educationEverydayQuizQuestionListOne.updateDate = updateDate;
  }
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    educationEverydayQuizQuestionListOne.userId = userId;
  }
  return educationEverydayQuizQuestionListOne;
}

Map<String, dynamic> $EducationEverydayQuizQuestionListOneToJson(EducationEverydayQuizQuestionListOne entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['addDate'] = entity.addDate;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['id'] = entity.id;
  data['optionA'] = entity.optionA;
  data['optionB'] = entity.optionB;
  data['optionC'] = entity.optionC;
  data['optionD'] = entity.optionD;
  data['parsing'] = entity.parsing;
  data['questionMain'] = entity.questionMain;
  data['questionTypeDicId'] = entity.questionTypeDicId;
  data['questionValidity'] = entity.questionValidity;
  data['score'] = entity.score;
  data['textbookId'] = entity.textbookId;
  data['type'] = entity.type;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['userId'] = entity.userId;
  return data;
}

extension EducationEverydayQuizQuestionListOneExtension on EducationEverydayQuizQuestionListOne {
  EducationEverydayQuizQuestionListOne copyWith({
    String? addDate,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? id,
    String? optionA,
    String? optionB,
    String? optionC,
    String? optionD,
    String? parsing,
    String? questionMain,
    String? questionTypeDicId,
    String? questionValidity,
    int? score,
    String? textbookId,
    int? type,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? userId,
  }) {
    return EducationEverydayQuizQuestionListOne()
      ..addDate = addDate ?? this.addDate
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..id = id ?? this.id
      ..optionA = optionA ?? this.optionA
      ..optionB = optionB ?? this.optionB
      ..optionC = optionC ?? this.optionC
      ..optionD = optionD ?? this.optionD
      ..parsing = parsing ?? this.parsing
      ..questionMain = questionMain ?? this.questionMain
      ..questionTypeDicId = questionTypeDicId ?? this.questionTypeDicId
      ..questionValidity = questionValidity ?? this.questionValidity
      ..score = score ?? this.score
      ..textbookId = textbookId ?? this.textbookId
      ..type = type ?? this.type
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..userId = userId ?? this.userId;
  }
}
